package com.zhongchaowuye.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.github.pagehelper.PageHelper;
import com.zhongchaowuye.dao.CarDao;
import com.zhongchaowuye.pojo.Car;
import com.zhongchaowuye.service.CarService;

@Transactional
@Service("carService")
public class CarServiceImpl implements CarService{
	@Resource
	CarDao carDao;
	
	@Override
	public int insertCar(Car c) {
		// TODO Auto-generated method stub
		return carDao.insertCar(c);
	}

	@Override
	public int updateCar(Car c) {
		// TODO Auto-generated method stub
		return carDao.updateCar(c);
	}

	@Override
	public int delCar(Car c) {
		// TODO Auto-generated method stub
		return carDao.delCar(c);
	}
	
	@Override
	public Car getCar(Car c) {
		// TODO Auto-generated method stub
		return carDao.getCar(c);
	}
	
	@Override
	public List<Map<String, Object>> getCarList(Car c) {
		// TODO Auto-generated method stub
		PageHelper.startPage(c.getPageIndex(),c.getPageSize(),true);
		return carDao.getCarList(c);
	}
}
